import axios from 'axios'


const request = axios.create({
  // 请求等待时间
  timeout: 5000,
})


// Add a request interceptor
// 请求拦截
axios.interceptors.request.use(function (config) {
  // Do something before request is sent
  console.log(11111111111111111111);
  return config;
}, function (error) {
  console.log(11111111111111111111);

  // Do something with request error
  return Promise.reject(error);
});

// Add a response interceptor

// 响应拦截
axios.interceptors.response.use(function (response) {
  // Do something with response data
  console.log(response);
  return response;
}, function (error) {
  console.log(11111111111111111111);

  // Do something with response error
  return Promise.reject(error);
});


export default request